/*********************************************************************
	\file :           os_sw_layers\bios\gpt\Gpt.h
	\brief:           General purpose timer.
	\author:          Omar Ramirez
	\version:         1.0
	\date:            Wed, 12, Feb 2014 
*********************************************************************/

#ifndef Gpt_H
#define Gpt_H

 
#include "Gpt_Cfg.h"
 
#include "typedef_OS.h"
 
#include "Mcu.h"
 


 
/********************************************************************************
* Package description: General purpose timer.                                   
*/
 
/********************************************************************************
* \brief Initializes the hardware timer module according to configuration set referenced by ConfigPtr.
* \param [In] ConfigPtr: Pointer to a selected configuration structure.
* \return             
*/
 
void Gpt_Init(const Gpt_ConfigType* ConfigPtr);

/********************************************************************************
* \brief Starts the selector timer channel with a defined timeout period.
* \param [In] Channel: Numeric identifier of the GPT channel.
* \param [In] Value: Timeout period (In number of ticks) after a notification shall occur.
* \return             
*/
 
void Gpt_StartTimer(Gpt_ChannelType Channel, Gpt_ValueType Value);

/********************************************************************************
* \brief Stops the selected timer channel.
* \param [In] Channel: Numeric identifier of the GPT channel.
* \return             
*/
 
void Gpt_StopTimer(Gpt_ChannelType Channel);

/********************************************************************************
* \brief Enables the invocation of the configured notification function for a channel.
* \param [In] Channel: Numeric identifier of the GPT channel.
* \return             
*/
 
void Gpt_EnableNotification(Gpt_ChannelType Channel);

/********************************************************************************
* \brief Disables the invocation of the configured notification function for a channel.
* \param [In] Channel: Numeric identifier of the GPT channel.
* \return             
*/
 
void Gpt_DisableNotification(Gpt_ChannelType Channel);

/********************************************************************************
* \brief PIT Channel 0 ISR --> Main CPU.
* \return             
*/
 
#pragma CODE_SEG __NEAR_SEG NON_BANKED  
 
void interrupt Gpt_Channel0_Isr(void);

#pragma CODE_SEG DEFAULT

#endif
/*********************************************************************
	File	: os_sw_layers\bios\gpt\Gpt.h 
*********************************************************************/
